/*--------------------------------------------------------------
 * File: demo55.c 编码类型：C语言  UTF-8
 * Author WRS (1352509846@qq.com)
 * 功能: 删除字符串中的特殊字符
 * 删除字符串中的除字母外的字符
 * Version 0.1
 * Date 2022-08-16 
 * 
 * @copyright Copyright (c) 2022
 * 
----------------------------------------------------------------*/
#include <stdio.h>

int main(int argc, char const *argv[])
{
    char line[150] = {0};
    int i,j;
    printf("输入一个字符串：");
    fgets(line, (sizeof(line)/sizeof(line[0])), stdin);

    for(i=0; line[i]!='\0';i++)
    {
        while ((line[i] >= 'a' && line[i] <= 'z') || (line[i] >= 'A' && line[i] <= 'Z') || line[i] == '\0')
        {
            for(j=i; line[j]!='\0'; j++)
            {
                line[j] = line[j+1];
            }
            line[j] = '\0';
        }
    }
    printf("输出：");
    puts(line);
    return 0;
}
